package aidansmeaton.airport.quickactions;

import net.londatiga.android.ActionItem;
import net.londatiga.android.QuickAction;
import aidansmeaton.airport.AirportOverlayItem;
import aidansmeaton.airport.R;
import aidansmeaton.airport.structures.Airport;
import android.view.View;
import android.view.View.OnClickListener;

import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

/**
 * A base class for map quick-action popups. Has one
 * action item.
 * 
 * @author Euan Freeman
 */
public class MapQuickAction extends QuickAction {
	
	private AirportOverlayItem item;
	private ActionItem sampleOption;
	private Airport airport;
	private MapView mapView;
	
	public MapQuickAction(View view, AirportOverlayItem item) {
		super(view);
		
		// Not quite working, setting the title of the quick action
		//
		//TextView quickActionTitle = (TextView) getRoot().findViewById(R.id.quickaction_itemname);
		//quickActionTitle.setText(airport.getName());
		
		this.item = item;
		this.airport = item.getAirport();
		this.mapView = (MapView) view;
		
		sampleOption = new ActionItem(view.getResources().getDrawable(R.drawable.ic_quickaction_info));
		sampleOption.setTitle(airport.getName());
		sampleOption.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				
			}
		});
		
		addActionItem(sampleOption);
		
		setAnimStyle(QuickAction.ANIM_AUTO);
		createActionList();
		
	}
	
	protected OverlayItem getItem() {
		return item;
	}

	protected void setItem(AirportOverlayItem item) {
		this.item = item;
	}

}